package com.example.stu1.login.controller;

import com.example.stu1.login.pojo.Login;
import com.example.stu1.login.service.LoginService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Resource
    private LoginService service;

    @RequestMapping("/query")
    public Login query(String loginName) {
        return service.query(loginName);
    }

    @RequestMapping("/query2")
    public Login query2(Integer loginId) { return service.query2(loginId); }

    @RequestMapping("/get")
    public Login get(Integer Id) { return service.get(Id); }

    @RequestMapping("/update")
    public void update(Integer Id,Integer Pw) { service.update(Id,Pw); }

    @RequestMapping("/add")
    public void add(Login login) { service.add(login); }
}
